<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			h2{
				text-align: center;
			}
			ul{
				list-style: none;
			}
		</style>
	</head>
	<body>
		<input type="button" onclick="test();" name="" id="" value="test" />
		<div id="box">
		</div>
		
	</body>
</html>
<script src="../jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	function test(){
		var xhl = new XMLHttpRequest;
		xhl.open('get','http://127.0.0.1:9999/diyi',true);
//		xhl.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		xhl.send(null);
		xhl.onreadystatechange = function(){
			if(xhl.readyState==4&&xhl.status==200){
				var str = '';
				str += '<h2>'+JSON.parse(xhl.responseText)[0].QuestionResult+'</h2>';
				var obj = JSON.parse(xhl.responseText)[0].listSurveyQuestione;
				for(var i in obj){
					if(i==1){
						str += '<div>'+obj[i].SurveyQuestionContent+'</div><ul>';
						for(var c in obj[i].listSurveyQuestionAskModel){
							str+="<li><input type='checkbox' />"+(obj[i].listSurveyQuestionAskModel)[c].AskValue+'</li>';
						}
						str +='</ul>';
					}else{
						str += '<div>'+obj[i].SurveyQuestionContent+'</div><ul>';
						for(var c in obj[i].listSurveyQuestionAskModel){
							str+="<li><input type='radio' />"+(obj[i].listSurveyQuestionAskModel)[c].AskValue+'</li>';
						}
						str +='</ul>';
					}
				}
				document.getElementById('box').innerHTML = str;
			}
		}
	}
	
	
</script>

